import { http } from "@/utils/http";
import {
  baseUrlApi,
  type UserResult,
  type RefreshTokenResult
} from "@/utils/apiPublic";

/**
 * @notes 登录
 * @param data
 * @returns
 */
export const getLogin = (data?: object) => {
  return http.request<UserResult>("post", baseUrlApi("admin/login/index"), {
    data
  });
};

/** 刷新token */
export const refreshTokenApi = (data?: object) => {
  return http.request<RefreshTokenResult>(
    "post",
    baseUrlApi("admin/login/refresh_token"),
    { data }
  );
};
